EMT Practice Test

1. Question Content...


Question List

Question1: Consider the following code:

Which statement could be used to determine the value of the first radio button?

Question2: Which example correctly implements inline scripting with JavaScript?

Question3: Which of the following will correctly declare the EmployeeID variable as a string data type?

Question4: Which of the following is a reason why a developer would use a JavaScript library?

Question5: Which of the following is a practice associated with the security risk known as cross-site scripting (XSS)?

Question6: Which choice best defines events and event handlers?

Question7: Consider the following message displayed in a pop-up window: Welcome to the CIW Web site! Which line of code will deliver the pop-up window that displays this message?

Question8: Suppose you define two variables as follows:
var x = 5;
var y = "5";
Which statement will return the mathematical sum of these variables?

Question9: Which script block will display Hello World in the browser when the script is run?

Question10: Consider the following code:
var myString= "Hello World";
alert(myString.length);
What is the output when you run this script in the browser?

Question11: Consider the following code:

When a user clicks on the displayed link, which site will he navigate to?

Question12: Which of the following comparison statements will return true?

Question13: Consider the following code:

What is the output when you run this script in the browser?

Question14: Which of the following will correctly modify the value of an X/HTML element's attribute within the DOM?

Question15: Consider the following code:

What output will appear in the browser when you run this script?

Question16: How is the alert() method different from prompt() and confirm()?

Question17: Consider the following code:

Will this function generate an error?

Question18: Which of the following is a browser security issue that JavaScript developers should remember when developing a script?

Question19: Consider the following code:

What is the expected result when you run this script in the browser?

Question20: What is the purpose of the prototype property in JavaScript?

Question21: Consider the following code:

What is the appropriate parameter for the alert() method in line 5 to reference the text in the firstName text box?

Question22: Consider the following code:

What needs to be changed to allow this script to run without error?

Question23: Consider the following code:

When an invalid e-mail address is entered, an alert is displayed to the user, but the form submission is not interrupted. What changes need to be made to the script in order to abort the submission if an invalid e- mail address is entered?

Question24: Maria, a 22-year old student, is testing her JavaScript application, which includes the following code:

Assuming Maria enters truthful information, what is the value of z after executing this code?

Question25: Consider the following code:

What is the expected result of this script?

Question26: Consider the following code:

What is the expected result when you run this script in the browser?

Question27: Which statement about the JavaScript form object is true?

Question28: Which statement is true about the getElementByID() method?

Question29: Consider the following select list:

Which of the following will select the third option in the list?